Skip to content

[sre_compile] Use TypeGuard for isstring - #15250

Merged
srittau merged 3 commits into
python:mainfrom
donbarbos:typeguard-isstring
Jan 10, 2026
Merged

[sre_compile] Use TypeGuard for isstring#15250
srittau merged 3 commits into
python:mainfrom
donbarbos:typeguard-isstring

Conversation

@donbarbos

Copy link
Copy Markdown
Contributor

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
srittau merged commit 9840c58 into python:main Jan 10, 2026
63 checks passed
Comment thread stdlib/sre_compile.pyi
@overload
def isstring(obj: str | bytes) -> Literal[True]: ...
@overload
def isstring(obj: object) -> TypeGuard[str | bytes]: ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be TypeIs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@donbarbos
donbarbos deleted the typeguard-isstring branch February 25, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants